using System;
using System.Collections.Generic;
using System.Text;
using SlimDX;
using SlimDX.Direct3D9;
using System.Runtime.InteropServices;
namespace Barrage.Global.Vertex
{
    /// <summary>
    /// Vertex format holding vertex position, vertex color and texture coordinates
    /// </summary>
    [StructLayout(LayoutKind.Sequential)]
    public struct VertexPositionColorUV
    {
        /// <summary>
        /// Vertex position
        /// </summary>
        public Vector3 Position;
        /// <summary>
        /// Vertex color
        /// </summary>
        public Color4 Color;
        /// <summary>
        /// Texture coordinates
        /// </summary>
        public Vector2 UV;

        /// <summary>
        /// Size in bytes of the structure
        /// </summary>
        public static int SizeBytes
        {
            get { return Marshal.SizeOf(typeof(VertexPositionColorUV)); }
        }



        /// <summary>
        /// VertexFormat declaration
        /// </summary>
        public static VertexFormat Format
        {
            get { return VertexFormat.Position | VertexFormat.Diffuse | VertexFormat.Texture1; }
        }

        /// <summary>
        /// Constructor. Inits values.
        /// </summary>
        /// <param name="position">Vertex position</param>
        /// <param name="color">Vertex color</param>
        /// <param name="UV">Texture coordinates</param>
        public VertexPositionColorUV(Vector3 position, Color4 color, Vector2 UV)
        {
            this.Position = position;
            this.Color = color;
            this.UV = UV;
        }
    }
}
